def test1(a, b=2, *args):
    print("a的值: ", a)
    print("b的值: ", b)
    for i in args:
        print(i)

test1(1)
test1(1, 4, 5, 6, 7)

# 关键字参数
def test2(a=1, b=2):
    print("a的值:", a)
    print("b的值: ", b)

test2(8, 9) # a=8, b=9
test2(b=9, a=8) # a=8, b=9  和参数顺序无关


# 可变关键字参数
def test3(a, b=2, **keyargs):
    print("a的值: ", a)
    print("b的值: ", b)
    for key, value in keyargs.items():
        print(key, value)

test3(1, 3, c=8, d=9)

# 混合参数  参数顺序很重要
def test1(a, b=2, *args, **keyargs):
    print("a的值: ", a)
    print("b的值: ", b)
    print("可变位置参数为: ", args)
    for key, value in keyargs.items():
        print(key, value)

test1(1, 3, 4, 5, 6, name="wayne", sex="male") # 
